import java.awt.event.*;
import javax.swing.*;

public class GUImenuItem implements ActionListener{
	GUI gui;
	
	public GUImenuItem(GUI gui) {
		this.gui = gui;
	}

	public void actionPerformed(ActionEvent e) {
		if(e.getActionCommand().equals("Exit client")) {
			gui.getClient().saveConfig();
			System.exit(0);
		}
		else if(e.getActionCommand().equals("Join new channel")) {
			gui.queryChannel();
		}
		else if(e.getActionCommand().equals("Connect")) {
			gui.connect();
		}
		else if(e.getActionCommand().equals("Disconnect")) {
			gui.disconnect();
		}
		else if(e.getActionCommand().equals("Change user info")) {
			gui.queryUserInfo();
		}
		else if(e.getActionCommand().equals("About nIRC")) {
			String msg = "IRC-client v1.0\nCreated by:\nJohan Lin�ker\nKjartan Gar�arsson M�rdal\nPontus Johansson\nGleb Chernenko";
			gui.showMessage(msg);
		}
		else if(e.getActionCommand().equals("Help")) {
			gui.showHelp();
		}
	}

}
